package reusingclasses;
/**
 * 
 * @author rjgcx
 * 2011-4-9
 */

class Useful{
	public void f(){
		
	}
	public void g(){
		
	}
}
		
class MoreUseful extends Useful{
	public void f(){}
	public void g(){}
	public void u(){}
	public void v(){}
	public void w(){}
}


public class RTTI {
	public static void main(String [] args){
		Useful [] x = {
				new Useful(),
				new MoreUseful()
		};
		
		for(Useful x1:x){
			if(x1 instanceof MoreUseful){
				System.out.println("I am MoreUseful");
			}
			else
				System.out.println("I am useful");
		}
	}
}
